feat: wandb logging for microbenchmarks and lm-eval accuracy - #183
feat: wandb logging for microbenchmarks and lm-eval accuracy#183Anirudhaagrawal wants to merge 1 commit into
Conversation
Add Weights & Biases integration to all three microbenchmarks (prefill, decode, stress) and the lm-eval accuracy evaluator, bringing them to parity with the full benchmark system's wandb support. Changes: - Add `wandb: WandbConfig` to `BaseMicrobenchmarkConfig` so all microbench CLIs expose `--wandb.enabled`, `--wandb.project`, etc. - Add `num_gpus` to `StressMicrobenchmarkConfig` for per-GPU throughput metrics (TPS/GPU vs TPS/User plots, the Sarvam/InferenceX style). - Add three lifecycle functions in `wandb_integration.py`: `maybe_init_microbench_wandb_run`, `maybe_log_microbench_results`, `maybe_finish_microbench_wandb_run` with type-specific logging (tables, scalars, plots, artifacts) for prefill/decode/stress. - Wire wandb lifecycle into `runner.run()` (prefill, decode, stress manual/range) and `_run_auto_main()` (stress auto mode). - Add `output_tps_per_gpu` / `input_tps_per_gpu` to StressPointResult, two new stress plots (TPS/GPU vs Load, TPS/GPU vs TPS/User), and TPS/GPU columns in the results table and JSON output. - Add TPS/GPU comparison plots to `veeksha diff` for stress results. - Add `_log_wandb_metrics()` to `LMEvalAccuracyEvaluator.save()` to log per-task accuracy scalars and results table when a wandb run is active. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Free Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughThis PR integrates Weights & Biases (W&B) logging throughout the evaluator and microbenchmark systems, adds per-GPU throughput metrics to stress benchmarks, and introduces new comparative performance plots. It adds comprehensive W&B helper functions for run initialization, metrics logging, and finalization. Changes
Sequence DiagramsequenceDiagram
participant Runner as Microbench Runner
participant WandB as W&B System
participant Benchmark as Benchmark Executor
participant Results as Results Logger
Runner->>WandB: maybe_init_microbench_wandb_run()
activate WandB
WandB->>WandB: Initialize run with config & tags
deactivate WandB
Runner->>Benchmark: Execute benchmark
activate Benchmark
Benchmark->>Benchmark: Run microbench (prefill/decode/stress)
Benchmark->>Benchmark: Generate results JSON
deactivate Benchmark
Runner->>Results: Print results table
activate Results
Results-->>Runner: Results displayed
deactivate Results
Runner->>WandB: maybe_log_microbench_results()
activate WandB
WandB->>WandB: Log metrics & tables by type
WandB->>WandB: Upload artifacts (JSON/CSV/PNG)
deactivate WandB
Runner->>WandB: maybe_finish_microbench_wandb_run()
activate WandB
WandB->>WandB: Persist run metadata & finalize
deactivate WandB
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Poem
Note 🎁 Summarized by CodeRabbit FreeYour organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login. Comment |
Summary
wandb: WandbConfigtoBaseMicrobenchmarkConfigso all microbench CLIs expose--wandb.*flags (prefill, decode, stress)num_gpustoStressMicrobenchmarkConfigfor TPS/GPU metrics and plots (TPS/GPU vs Load, TPS/GPU vs TPS/User — the Sarvam/InferenceX-style throughput curves)wandb_integration.py:maybe_init_microbench_wandb_run,maybe_log_microbench_results,maybe_finish_microbench_wandb_runwith type-specific logging (tables, scalars, plots, artifacts)runner.run()(all manual/range microbench modes) and_run_auto_main()(stress auto mode)output_tps_per_gpu/input_tps_per_gputoStressPointResult, TPS/GPU columns in rich table and JSON outputveeksha difffor stress results_log_wandb_metrics()toLMEvalAccuracyEvaluator.save()to log per-task accuracy scalars and results table when a wandb run is activeTest plan
make lintpasses (excluding pre-existing black bug inslo/metrics.py)python -m pytest tests/unit/ -x -qpasses (213/214 pass; 1 failure is pre-existing env issue: port 8000 in use)uvx --python 3.14t veeksha stress --helpshows--wandb.*and--num_gpusflagsuvx --python 3.14t veeksha prefill --helpshows--wandb.*flagsuvx --python 3.14t veeksha decode --helpshows--wandb.*flags🤖 Generated with Claude Code
Summary by CodeRabbit